package com.herongo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodComment {
    private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    private String content;// 评论内容
    private Integer userId;// 评论作者ID
    private Integer level; //评论等级
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss", iso = DateTimeFormat.ISO.DATE_TIME)
    @JsonFormat(pattern = DATE_FORMAT,timezone = "GMT+8")
    private Date createTime;// 创建时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss", iso = DateTimeFormat.ISO.DATE_TIME)
    @JsonFormat(pattern = DATE_FORMAT,timezone = "GMT+8")
    private Date modifyAt;// 修改时间
    private Integer goodId;// 商品ID
    private GoodDetailmg goodDetailmg;

    public GoodComment(String content, Integer userId, Integer level, Date createTime, Date modifyAt, Integer goodId) {
        this.content = content;
        this.userId = userId;
        this.level = level;
        this.createTime = createTime;
        this.modifyAt = modifyAt;
        this.goodId = goodId;
    }
}
